package 曾世昌12_4;

import java.util.Scanner;

public class demo2 {
    public static void main(String[] args) throws Exception {
        Scanner scanner = new Scanner( System.in );
       while (true){
           int a=0;int b=0;
           for (int i = 0; i <2 ; i++) {
               System.out.println("请输入第"+(++a)+"个数字：");
               int nextInt1 = 0;
               try {
                   nextInt1 = scanner.nextInt();
               } catch (Exception e) {
                   throw  new Exception( "输入类型错误！！！" );
               }
               b+=nextInt1;
           }
           if (a==2){
               a=0;
               System.out.println("两数之和为:"+b);
               b=0;
           }
       }

    }
}
